/*
 * Description: 系统配置服务
 * Author: wangyifei
 * DateCreated: 2024-06-17 11:11
 */

import { type IResList, configHttp } from '@/utils/request';

// 查询单位列表
export interface UnitParam {
	id?: number;
	isValid?: number;
	pid?: number;
	sortNo?: number;
	unitCode?: string;
	unitLogo?: string;
	unitName?: string;
	unitType?: number;
}
export interface UnitRes {
	id: number;
	isValid: number;
	operateTime: string;
	operator: number;
	operatorName: string;
	pid: number;
	remark: string;
	sortNo: number;
	unitCode: string;
	unitLogo: string;
	unitName: string;
	unitType: number;
}
export const selectUnitList = (data: UnitParam) =>
	configHttp.post<IResList<UnitRes>>({
		url: '/sys-unit/list',
		data
	});

// 查询部门列表
export interface DeptParam {
	deptCode?: string;
	deptName?: string;
	isValid?: number;
	pid?: number;
	unitId?: number;
}
export interface DeptRes {
	deptCode: string;
	deptName: string;
	id: number;
	isValid: number;
	pid: number;
	remark: string;
	unitId: number;
}
export const selectDeptList = (data: DeptParam) =>
	configHttp.post<IResList<DeptRes>>({
		url: '/sys-department/list',
		data
	});

// 查询用户列表
export interface UserParam {
	age?: number;
	departmentId?: number;
	unitId?: number;
	dirTreeClassify?: number;
	email?: string;
	endDate?: string;
	faxNo?: string;
	fondsId?: number;
	gender?: number;
	headUrl?: string;
	homeAddress?: string;
	homeTel?: string;
	ip?: string;
	isParttimeUser?: number;
	isTempUser?: number;
	isValid?: number;
	lockStatus?: number;
	lockTime?: string;
	macAddress?: string;
	mobile?: string;
	nickname?: string;
	officeAddress?: string;
	officeTel?: string;
	password?: string;
	positionTitle?: string;
	pwdInputErrorTimes?: number;
	pwdUp?: string;
	pwdUpdateTime?: string;
	qq?: string;
	realname?: string;
	securityClass?: number;
	startDate?: string;
	userType?: number;
	username?: string;
	wechat?: string;
}
export interface UserRes extends UserParam {
	id?: number;
}
export const selectUserList = (data: UserParam) =>
	configHttp.post<IResList<UserRes>>({
		url: '/sys-user/list',
		data
	});
